{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Bill Print Response",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "identifier" : {
      "type" : "integer",
      "description" : "Unique identifier for each file that is produced or processed by CMP"
    },
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "Billing" ],
      "description" : "CMP categorisation of the job associated with this file "
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "Bill Print" ],
      "description" : "Sub-categorisation of the job"
    },
    "version" : {
      "type" : "number",
      "minimum" : 1.7,
      "maximum" : 1.7,
      "description" : "The current version of the generic extract file. This must match the corresponding inbound file."
    },
    "batchDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Represents when a batch was created in CMP"
    },
    "extractDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Represents when a generic CMP file was created from a batch"
    },
    "recordCount" : {
      "type" : "integer",
      "description" : "Number of records within the original batch"
    },
    "languageIdentifier" : {
      "type" : "string",
      "maxLength" : 6,
      "description" : "Language identifier that is applicable to all the data within this file"
    },
    "isoCurrencyCode" : {
      "type" : "string",
      "pattern" : "^([a-zA-Z]){3}",
      "minLength" : 3,
      "maxLength" : 3,
      "description" : "The ISO 4217 currency code for the monetary amounts that are specified."
    },
    "voiceUnitMeasure" : {
      "type" : "string",
      "maxLength" : 10,
      "description" : "Measure that is applicable to all voice usage within this file. Typically, this would be in seconds "
    },
    "dataUnitMeasure" : {
      "type" : "string",
      "maxLength" : 10,
      "description" : "Measure that is applicable to all data usage within this file. Typically, this would be in kilobytes "
    },
    "callCentreContactNumber" : {
      "type" : "string",
      "maxLength" : 70,
      "description" : "Call centre contact number that will be printed on all subscription bills, they can contact this number if they have a query relating to their bill"
    },
    "callCentreContactEmail" : {
      "type" : "string",
      "maxLength" : 70,
      "description" : "Call centre contact email that will be printed on all subscription bills, they can contact this email if they have a query relating to their bill"
    },
    "callCentreWebAddress" : {
      "type" : "string",
      "maxLength" : 50,
      "description" : "Call centre web address that will be printed on all subscription bills"
    },
    "callCentreOpeningHours" : {
      "type" : "string",
      "maxLength" : 20,
      "description" : "Call centre opening hours that will be printed on all subscription bills"
    },
    "envelopes" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/ResponseEnvelope"
      },
      "description" : "All batches consists of one or more envelopes which represent distinct billing addresses"
    }
  },
  "required" : [ "batchDateTime", "extractDateTime" ],
  "definitions" : {
    "ResponseEnvelope" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "billingMedia" : {
          "$ref" : "#/definitions/BillingMedia",
          "description" : "Billing media information"
        },
        "isCopy" : {
          "type" : "boolean",
          "description" : "Deprecated"
        },
        "isMarketingExcluded" : {
          "type" : "boolean",
          "description" : "Not currently used"
        },
        "emailAddress" : {
          "type" : "string",
          "maxLength" : 70,
          "description" : "Email address of the subscription or account that is to receive the invoice/statement/detailed bill"
        },
        "postalAddress" : {
          "$ref" : "#/definitions/PostalAddress",
          "description" : "Postal address information"
        },
        "statements" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Statement"
          },
          "description" : "Statement information"
        },
        "invoices" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Invoice"
          },
          "description" : "Invoice information"
        },
        "detailedBills" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/DetailedBill"
          },
          "description" : "Detailed bill information"
        }
      }
    },
    "BillingMedia" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Unique identifier for a billing media code. Indicates a subscription preferred method of receiving their invoice.  Subscription can opt to receive standard format, large font format, audio, braille or email"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of the billing media"
        }
      }
    },
    "PostalAddress" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "title" : {
          "type" : "string",
          "maxLength" : 10,
          "description" : "Title by which a subscription wishes to be referred to as"
        },
        "foreName" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "First name of a subscription"
        },
        "middleName" : {
          "type" : "string",
          "maxLength" : 20,
          "description" : "Middle name of a subscription"
        },
        "surname" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Surname of a subscription"
        },
        "companyName" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of a company"
        },
        "companyRegistrationNumber" : {
          "type" : "string",
          "maxLength" : 25,
          "description" : "Registration Number of the company"
        },
        "postCode" : {
          "type" : "string",
          "maxLength" : 10,
          "description" : "Post Code of a subscription"
        },
        "addressLines" : {
          "type" : "array",
          "minItems" : 0,
          "maxItems" : 5,
          "items" : {
            "$ref" : "#/definitions/AddressLine"
          },
          "description" : "Address Line Information"
        }
      }
    },
    "AddressLine" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "line" : {
          "type" : "string",
          "maxLength" : 60,
          "description" : "Address of a particular subscription. Address line 1 is mandatory, rest are optional"
        }
      }
    },
    "Statement" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "statementId" : {
          "type" : "integer",
          "description" : "Unique Identifier for a statement"
        },
        "statementDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Date the statement was produced"
        },
        "forAttentionOfName" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Recipient of the statement"
        },
        "accountNumber" : {
          "type" : "integer",
          "description" : "Only populated where statement production has been consolidated at individual account level"
        },
        "totalAmountDue" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9999999.99,
          "description" : "This is the total of ALL closing balances for accounts that are part of this statement"
        },
        "corporate" : {
          "$ref" : "#/definitions/Corporate",
          "description" : "Only populated where statement production has been consolidated to a corporate"
        },
        "group" : {
          "$ref" : "#/definitions/Group",
          "description" : "Only populated where statement production has been consolidated to a group"
        },
        "accounts" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/StatementAccount"
          },
          "description" : "Account Information"
        }
      },
      "required" : [ "statementDate" ]
    },
    "Corporate" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 6,
          "description" : "Unique identifier for a corporate, this represents the corporate structure that a subscription is associated with"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of a corporate"
        }
      }
    },
    "Group" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Unique identifier for a group, this represents the group structure that a subscription is associated with"
        },
        "description" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 30,
          "description" : "Actual name of a group"
        }
      }
    },
    "StatementAccount" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "accountId" : {
          "type" : "integer",
          "description" : "Unique account number identifier"
        },
        "previousClosingBalance" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary amount representing the previous closing balance on the account"
        },
        "openingBalance" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary amount comprising of previous closing balance minus any open query amounts plus or minus transactions since last statement period"
        },
        "closingBalance" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary amount comprising of open balance plus any charges this period"
        },
        "queryAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary amount comprising of any amount that are in dispute from a subscription point of view"
        },
        "isPosting" : {
          "type" : "boolean",
          "description" : "Indicates if this account is a posting account or not"
        },
        "corporate" : {
          "$ref" : "#/definitions/Corporate",
          "description" : "Populated if account is part of a corporate structure"
        },
        "totalPayments" : {
          "type" : "number",
          "minimum" : 1.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary total of gross amounts for all the payments on this account for this period"
        },
        "totalAdjustments" : {
          "type" : "number",
          "minimum" : 1.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary total of gross amounts for all the adjustments on this account for this period"
        },
        "totalCharges" : {
          "type" : "number",
          "minimum" : 1.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary total of gross amounts for all the charges on this account for this period"
        },
        "payments" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Payment"
          },
          "description" : "Payment Information"
        },
        "adjustments" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Adjustment"
          },
          "description" : "Adjustment information"
        },
        "charges" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Charge"
          },
          "description" : "charge information"
        },
        "paymentPlan" : {
          "$ref" : "#/definitions/PaymentPlan",
          "description" : "Payment Plan Information"
        }
      }
    },
    "Payment" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "date" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Represents the date the payment was made on"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 25,
          "description" : "Short description outlining the nature of the payment"
        },
        "grossAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary amount of the payment including the tax"
        },
        "documentType" : {
          "$ref" : "#/definitions/DocumentType",
          "description" : "Document Type information"
        },
        "documentNumber" : {
          "type" : "integer",
          "description" : "Unique reference number for the payment"
        }
      },
      "required" : [ "date" ]
    },
    "DocumentType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 2,
          "description" : "Unique identifier which identifies the transaction type.  These types are used for invoice and receipt entry by a Sales Ledger"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 25,
          "description" : "Actual name of the document type"
        }
      }
    },
    "Adjustment" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "date" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Represents the date the adjustment was made on"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Short description outlining the nature of the adjustment"
        },
        "grossAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary amount of the adjustment including the tax"
        },
        "documentType" : {
          "$ref" : "#/definitions/DocumentType",
          "description" : "Document Type information"
        },
        "documentNumber" : {
          "type" : "integer",
          "description" : "Unique reference number for the adjustment"
        }
      }
    },
    "Charge" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "invoiceId" : {
          "type" : "integer",
          "description" : "Unique Identifier of the invoice"
        },
        "grossAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Monetary amount of the adjustment including the tax"
        }
      }
    },
    "PaymentPlan" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "requestedDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Paymennt plan requested date"
        },
        "cancellationDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Payment plan cancellation date"
        },
        "numberOfInstalments" : {
          "type" : "integer",
          "description" : "Number of instalments the due amount should be paid"
        },
        "paymentPlanDetails" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/DetailedPaymentPlan"
          },
          "description" : "Payment plan details associated with the payment plan header"
        }
      },
      "required" : [ "requestedDate", "cancellationDate", "numberOfInstalments" ]
    },
    "DetailedPaymentPlan" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "instalmentDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Instalment date"
        },
        "instalmentAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Instalment amount to be paid"
        }
      },
      "required" : [ "instalmentDate", "instalmentAmount" ]
    },
    "Invoice" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "invoiceId" : {
          "type" : "integer",
          "description" : "Unique number identifying a particular invoice"
        },
        "accountId" : {
          "type" : "integer",
          "description" : "Represents the account to which invoice charges have been consolidated to"
        },
        "invoiceTaxDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Tax date that was used to generate an invoice"
        },
        "invoiceType" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Indicator to third parties to let them know the content of a particular invoice. An invoice can be for multiple subscriptions and it is useful to know if one of those subscriptions is receiving their first or final Invoice Values can be either FIRST , NORMAL or FINAL"
        },
        "totalChargesThisPeriodExcludingTax" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Represents the total charges this period prior to any tax being applied"
        },
        "taxAppliedThisPeriod" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 1.0E13,
          "description" : "Represents the tax that will be applied this period"
        },
        "totalAmountDue" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 1.0E13,
          "description" : "Represents the overall charge i.e. net plus tax"
        },
        "paymentAdvice" : {
          "$ref" : "#/definitions/PaymentAdvice",
          "description" : "Payment advice information"
        },
        "accounts" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Account"
          },
          "description" : "Account information"
        },
        "subscriptions" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Subscription"
          },
          "description" : "Subscription Information"
        }
      },
      "required" : [ "invoiceTaxDate" ]
    },
    "PaymentAdvice" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "paymentDueDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Date representing when payment is due for this invoice, calculated from payment terms"
        },
        "paymentType" : {
          "$ref" : "#/definitions/PaymentType",
          "description" : "Payment Type information"
        },
        "giroReference" : {
          "$ref" : "#/definitions/GiroReference",
          "description" : "Giro reference, only applicable where subscription has opted for a manual payment option"
        }
      },
      "required" : [ "paymentDueDate" ]
    },
    "PaymentType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "code" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Unique identifier for an payment type, it is associated with account."
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of the payment type"
        }
      }
    },
    "GiroReference" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "accountNumber" : {
          "type" : "integer",
          "description" : "Represents the account to which invoice charges have been consolidated to"
        },
        "companyBIC" : {
          "type" : "string",
          "description" : "Represents the Sort Code of the company"
        },
        "companyIBAN" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Represents the International Bank Account Number of the company"
        },
        "companyRegisteredNumber" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Represents the Registered Number of the company"
        },
        "companyRegisteredAddress" : {
          "$ref" : "#/definitions/CompanyAddress",
          "description" : "Company Registered Address"
        }
      }
    },
    "CompanyAddress" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "companyName" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of a company"
        },
        "postCode" : {
          "type" : "string",
          "maxLength" : 10,
          "description" : "Post Code of a subscription"
        },
        "addressLines" : {
          "type" : "array",
          "minItems" : 0,
          "maxItems" : 5,
          "items" : {
            "$ref" : "#/definitions/AddressLine"
          },
          "description" : "Address Line Information"
        }
      }
    },
    "Account" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "accountId" : {
          "type" : "integer",
          "description" : "Unique identifier for an account"
        },
        "accountType" : {
          "$ref" : "#/definitions/AccountType",
          "description" : "Account type for credit management activities"
        },
        "accountName" : {
          "type" : "string",
          "maxLength" : 40,
          "description" : "Actual name associated with the account"
        },
        "firstInvoiceDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Date on which this account was first invoiced"
        },
        "lastInvoiceDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Last invoice date for an account"
        },
        "invoiceFrequency" : {
          "$ref" : "#/definitions/InvoiceFrequency",
          "description" : "Indicates invoice frequency information'"
        },
        "corporate" : {
          "$ref" : "#/definitions/Corporate",
          "description" : "Corporate information"
        },
        "group" : {
          "$ref" : "#/definitions/Group",
          "description" : "Group information"
        },
        "accountBillItems" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/AccountBillItem"
          },
          "description" : "Information related to account activities to be billable"
        }
      },
      "required" : [ "firstInvoiceDate", "lastInvoiceDate" ]
    },
    "AccountType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 3,
          "description" : "Unique identifier for an account type code, it is associated with account. Used to group related accounts together for credit management activities"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of the account type"
        }
      }
    },
    "InvoiceFrequency" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "indicator" : {
          "type" : "string",
          "minLength" : 3,
          "maxLength" : 5,
          "description" : "Indicates how often an invoice will be produced, this can be either 'Month' or 'Day'"
        },
        "value" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 999,
          "description" : "Indicates the cycle day of when an invoice will be produced for a subscription"
        }
      }
    },
    "AccountBillItem" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "serviceId" : {
          "type" : "string",
          "maxLength" : 25,
          "description" : "The primary network serial number that is associated with a subscription"
        },
        "billItemGroup" : {
          "$ref" : "#/definitions/BillItemGroup",
          "description" : "Bill Item Group Information"
        },
        "billItem" : {
          "$ref" : "#/definitions/BillItem",
          "description" : "Bill Item information"
        },
        "billItemConsolidation" : {
          "$ref" : "#/definitions/BillItemConsolidation",
          "description" : "Bill Item consolidation information"
        },
        "chargeStartDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Start date of the period that this charge or credit relates to . Typically this date is populated but it can be empty for a per bill recurring charge"
        },
        "chargeEndDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "End date of the period that this charge or credit relates to . Typically this date is populated but it can be empty for a per bill recurring charge"
        },
        "netAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Net amount of the actual charge (positive value) or credit (negative value)"
        },
        "taxAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 1.0E13,
          "description" : "Tax amount associated with bill item line, this can be positive or negative depending on whether you are dealing with a charge or a credit"
        },
        "taxRate" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 99999.99,
          "description" : "tax rate that was applied to this bill item line"
        },
        "quantity" : {
          "type" : "integer",
          "description" : "Represents the quantity"
        },
        "reference" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Represent the reference of account service"
        },
        "orderDetail" : {
          "$ref" : "#/definitions/OrderDetail",
          "description" : "Order Detail Information"
        }
      }
    },
    "BillItemGroup" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Unique identifier for a bill item group code. This is a container for bill item, it allows for related bill items to be grouped together logically for presentation on an invoice "
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of the bill item group"
        },
        "sequence" : {
          "type" : "integer",
          "description" : "Sequence associated with bill item group, can be used by third party print bureau to organise bill item group presentation on an invoice"
        }
      }
    },
    "BillItem" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Unique identifier for a bill item code. This represents an actual charge or credit for a particular subscription"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Actual name of the bill item"
        },
        "sequence" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 9999999,
          "description" : "Sequence associated with bill item, can be used by third party print bureau to organise bill item presentation within a bill item group on an invoice"
        }
      }
    },
    "BillItemConsolidation" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Identifier for bill item consolidation. This allows for bill items to be grouped together as a single charge on a invoice"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Actual name of the bill item consolidation"
        }
      }
    },
    "OrderDetail" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "customerOrderReference" : {
          "type" : "string",
          "maxLength" : 60,
          "description" : "Reference number associated with a particular order"
        },
        "orderNumber" : {
          "type" : "string",
          "maxLength" : 15,
          "description" : "This is an identifier to uniquely represent an order within CMP"
        },
        "orderDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "This represents the date the order was created"
        },
        "itemQuantity" : {
          "type" : "integer",
          "minimum" : 0,
          "maximum" : 9999,
          "description" : "Actual quantity ordered of a particular order"
        }
      }
    },
    "Subscription" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "serviceId" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 25,
          "description" : "Unique Identifier of the service"
        },
        "isParent" : {
          "type" : "boolean",
          "description" : "Indicates if the subscription is the designated parent subscription for the account"
        },
        "network" : {
          "$ref" : "#/definitions/Network",
          "description" : "Network Information"
        },
        "plan" : {
          "$ref" : "#/definitions/Plan",
          "description" : "Plan Information"
        },
        "previousNetwork" : {
          "$ref" : "#/definitions/PreviousNetwork",
          "description" : "Previous Network Information"
        },
        "previousPlan" : {
          "$ref" : "#/definitions/PreviousPlan",
          "description" : "Previous Plan Information"
        },
        "planChangeDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The date of the latest price plan change for a subscription"
        },
        "billingStartDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The date of when a subscription was first connected in CMP"
        },
        "billingEndDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The date of when a subscription was disconnected in CMP"
        },
        "firstInvoiceDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The date an invoice was first produced for a subscription"
        },
        "lastInvoiceDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The production date of the latest invoice for a subscription"
        },
        "invoiceFrequency" : {
          "$ref" : "#/definitions/InvoiceFrequency",
          "description" : "Invoice frequency information"
        },
        "userName" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 30,
          "description" : "The name of a subscription"
        },
        "subscriptionInvoiceType" : {
          "type" : "string",
          "minLength" : 5,
          "maxLength" : 6,
          "description" : "Identifier indicating if this is the first invoice, normal invoice or final invoice for a subscription. Contains either 'FIRST', 'NORMAL' or 'FINAL' "
        },
        "accountId" : {
          "type" : "integer",
          "description" : "Account that is associated with a subscription"
        },
        "corporate" : {
          "$ref" : "#/definitions/Corporate",
          "description" : "Corporate Code Information"
        },
        "group" : {
          "$ref" : "#/definitions/Group",
          "description" : "Group Code Information"
        },
        "subscriptionBillItems" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/SubscriptionBillItem"
          },
          "description" : "Represents a list of bill items that a subscription will be charged for. Some of these can be zero priced or negative in the case of a discount"
        },
        "costCentre" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 20,
          "description" : "Cost centre of a subscription"
        }
      },
      "required" : [ "billingStartDate", "firstInvoiceDate", "lastInvoiceDate" ]
    },
    "Network" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 6,
          "description" : "Unique identifier for a network, represents the current network that a subscription is linked to"
        },
        "description" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 30,
          "description" : "Actual name of a network"
        }
      }
    },
    "Plan" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 6,
          "description" : "Unique identifier for a price plan code, represents the current price plan a subscription is assigned to"
        },
        "description" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 30,
          "description" : "Actual name of a price plan"
        },
        "attributes" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Attributes"
          },
          "description" : "Attributes Information"
        }
      }
    },
    "Attributes" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "attributeDescription" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Description of the price plan attribute"
        },
        "attributeValue" : {
          "type" : "string",
          "maxLength" : 120,
          "description" : "Price plan attribute value"
        }
      }
    },
    "PreviousNetwork" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 6,
          "description" : "Unique identifier for a network, represents the previous network a subscription was associated with prior to their current network"
        },
        "description" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 30,
          "description" : "Actual name of a network"
        }
      }
    },
    "PreviousPlan" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 6,
          "description" : "Unique identifier for a price plan code, represents the price plan a subscription was assigned prior to their current one"
        },
        "description" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 30,
          "description" : "Actual name of a price plan"
        }
      }
    },
    "SubscriptionBillItem" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "serviceId" : {
          "type" : "string",
          "maxLength" : 25,
          "description" : "The primary network serial number that is associated with a subscription"
        },
        "billItemGroup" : {
          "$ref" : "#/definitions/BillItemGroup",
          "description" : "Subscription Bill Item Information"
        },
        "billItem" : {
          "$ref" : "#/definitions/BillItem",
          "description" : "Bill Item Information"
        },
        "billItemConsolidation" : {
          "$ref" : "#/definitions/BillItemConsolidation",
          "description" : "Bill Item consolidation information"
        },
        "chargeStartDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Start date of the period that this charge or credit relates to . Typically this date is populated but it can be empty for a per bill recurring charge"
        },
        "chargeEndDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "End date of the period that this charge or credit relates to Typically this date is populated but it can be empty for a per bill recurring charge"
        },
        "netAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Net amount of the actual charge (positive value) or credit (negative value)"
        },
        "taxAmount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 1.0E13,
          "description" : "Tax amount associated with bill item line, this can be positive or negative depending on whether you are dealing with a charge or a credit"
        },
        "taxRate" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 99999.99,
          "description" : "Tax rate that was applicable to this bill item"
        },
        "usageCount" : {
          "type" : "integer",
          "description" : "Count of usage that is stamped with this bill item and bill item group"
        }
      }
    },
    "DetailedBill" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "invoiceId" : {
          "type" : "string",
          "maxLength" : 10,
          "description" : "Unique Identifier of the invoice"
        },
        "serviceIdentifiers" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/ServiceIdentifier"
          },
          "description" : "Service identifier information"
        }
      }
    },
    "ServiceIdentifier" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "serviceId" : {
          "type" : "string",
          "maxLength" : 25,
          "description" : "The primary network serial number that is associated with a subscription"
        },
        "usagePeriodStartDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The start date of usage and usage base allowances for this billing period"
        },
        "usagePeriodEndDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The end date of usage and usage base allowances for this billing period"
        },
        "usageDetails" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/UsageDetail"
          },
          "description" : "Usage details information"
        },
        "usageAllowances" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/UsageAllowance"
          },
          "description" : "Usage allowance information"
        }
      },
      "required" : [ "usagePeriodStartDate", "usagePeriodEndDate" ]
    },
    "UsageDetail" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "usageDateTime" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Represents the date and time the usage was initiated"
        },
        "usageClassification" : {
          "$ref" : "#/definitions/UsageClassification",
          "description" : "Usage Classification Information"
        },
        "billItem" : {
          "$ref" : "#/definitions/BillItem",
          "description" : "This is the Bill Item"
        },
        "destination" : {
          "type" : "string",
          "maxLength" : 18,
          "description" : "The number or destination IP address that the subscription sent the voice, text or data session to"
        },
        "unitType" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Indicates the nature of the usage This can be voice, text or data"
        },
        "actualUsageUnits" : {
          "type" : "integer",
          "description" : "The actual duration of the usage session in seconds, kilobytes or quantity (text)"
        },
        "billableUsageUnits" : {
          "type" : "integer",
          "description" : "The billable duration of the usage session in seconds, kilobytes or quantity (text). This is to cater for situation where usage is rounded upwards e.g. an actual duration of 45 seconds might be rounded up to 1 minute for invoicing "
        },
        "wholesaleCharge" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "The wholesale monetary cost of the usage"
        },
        "retailCharge" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "The monetary cost of the usage. This can be zero if the usage has been paid for from an inclusive allowance "
        },
        "accessCharge" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 999999.99,
          "description" : "The retail monetary cost of the service potion of the usage"
        },
        "serviceCharge" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 999999.99,
          "description" : "The retail monetary cost of the service potion of the usage"
        },
        "discountValue" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9999999.9999,
          "description" : "The discount monetary amount applied to the usage"
        }
      },
      "required" : [ "usageDateTime" ]
    },
    "UsageClassification" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "maxLength" : 12,
          "description" : "This represents the usage class code that allows similar usage to be grouped together for invoicing and bill purposes"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual description of the usage class code"
        }
      }
    },
    "UsageAllowance" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "allowance" : {
          "$ref" : "#/definitions/Allowance",
          "description" : "Allowance information"
        },
        "allowanceConsumption" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 1.0E17,
          "description" : "Total of all the consumption from a subscriptions particular allowance in the period being invoiced. This value can either be money, seconds, kilobytes or quantity (texts) depending on type of allowance "
        },
        "allowanceValue" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.99999999999E9,
          "description" : "Total allowance value that is available to a subscription at the start of an invoice period. This value can either be money, seconds, kilobytes or quantity (texts) depending on type of allowance  "
        },
        "allowanceType" : {
          "type" : "string",
          "maxLength" : 6,
          "description" : "Indicates type of allowance you are dealing with. Possible values are money, seconds, kilobytes or quantity"
        },
        "unitOfMeasure" : {
          "type" : "string",
          "maxLength" : 8,
          "description" : "Allowance unit of measure"
        },
        "isPrepaid" : {
          "type" : "boolean",
          "description" : "Indicates if the allowance is pre-paid or post-paid type"
        },
        "isShared" : {
          "type" : "boolean",
          "description" : "Indicates if the allowance can be shared across multiple subscriptions in the same structure"
        },
        "isRollover" : {
          "type" : "boolean",
          "description" : "Indicates if the allowance rolls over automatically on a subscriptions bill cycle"
        },
        "isRecurring" : {
          "type" : "boolean",
          "description" : "Indicates if the allowance is a one off or recurring"
        },
        "isUnlimited" : {
          "type" : "boolean",
          "description" : "Indicates if the allowance has no upper consumption limit"
        }
      }
    },
    "Allowance" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "integer",
          "description" : "Unique identifier, represents the real time allowance that usage consumed from"
        },
        "description" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Actual name of the allowance"
        }
      }
    }
  }
}
